package com.orphan.marketBack.service.impl;

import com.orphan.marketBack.dao.GoodsOutMapper;
import com.orphan.marketBack.po.GoodsOut;
import com.orphan.marketBack.service.GoodsOutService;
import com.orphan.marketBack.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsOutServiceImpl implements GoodsOutService {
    @Autowired
    private GoodsOutMapper goodsOutMapper;

    @Override
    public boolean inset(GoodsOut goodsOut) {
        int insert = goodsOutMapper.insert(goodsOut);
        if (insert > 0){
            return true;
        }else{
            return false;
        }
    }

    @Override
    public ResultVO getGoodsOut() {
        List<GoodsOut> goodsOut = goodsOutMapper.getGoodsOut();
        ResultVO resultVO = new ResultVO();
        resultVO.setTotal(goodsOut.size());
        resultVO.setData(goodsOut);

        return resultVO;
    }
}
